This adds both a compile time check for the SDK version being
compiled against, as well as a runtime check in the case the
resulting binary is run against an older SDK.
https://bugzilla.gnome.org/show_bug.cgi?id=735054
GtkIconTheme *theme;
GtkIconInfo *info;
- gint scale;
+ gint scale = 1;
if (!parsed)
{
}
theme = gtk_icon_theme_get_default ();
- scale = roundf ([[NSScreen mainScreen] backingScaleFactor]);
+
+#ifdef AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
+ /* we need a run-time check for the backingScaleFactor selector because we
+ * may be compiling on a 10.7 framework, but targeting a 10.6 one
+ */
+ if ([[NSScreen mainScreen] respondsToSelector:@selector(backingScaleFactor)])
+ scale = roundf ([[NSScreen mainScreen] backingScaleFactor]);
+#endif
info = gtk_icon_theme_lookup_by_gicon_for_scale (theme, icon, ICON_SIZE, scale, GTK_ICON_LOOKUP_USE_BUILTIN);
if (info != NULL)